﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Glorysoft.EAP.Core.Entities
{
    public class TranslateMsg
    {
        public static string ClientLanguage = "EN";

        public static Dictionary<string, string> GetTranslation(string msgName)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", Messages[msgName].Split(':')[0]);
                msgs.Add("EN", Messages[msgName].Split(':')[1]);

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }

        public static Dictionary<string, string> GetTranslation(string msgName, params object?[] args)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", string.Format(Messages[msgName].Split(':')[0], args));
                msgs.Add("EN", string.Format(Messages[msgName].Split(':')[1], args));

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }

        public static string GetENTranslation(string msgName)
        {
            try
            {
                return Messages[msgName].Split(':')[1];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static string GetCNTranslation(string msgName)
        {

            try
            {
                return Messages[msgName].Split(':')[0];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static Dictionary<string, string> Messages = new Dictionary<string, string>
        {
            #region EQPStatus
            //{"ControlModeChange","EQP> 设备控制模式切换为{0}.:EQP> Equipment mode is changed to {0}."},
            //{"OfflineAlarm","EQP> 当前设备控制模式为Offline,请切换至Online.:EQP> The Eq Control Mode Is Offline, Please change to Online.."},
            //{"StatusAbnormalCh","EQP> 当前设备状态无法执行此操作,请确认后再尝试.:EQP> This operation cannot be performed in the current eqp state,Please confirm and try again."},
            //{"StartScreenCh","EQP> 把设备切换成开始界面.:EQP> Switch the eqp to the start screen."},
            #endregion
            #region RecipeUpload
            {"RecipeUploadStartCh","RMS> 程序{0}开始上传...:RMS> Recipe {0} start upload..."},
            {"RecipeUploadOKCh","RMS> 程序{0}上传成功.:RMS> Recipe {0} upload success."},
            {"RecipeUploadFailCh","RMS> 程序{0}上传失败.{1}:RMS> Recipe {0} upload failed. {1}"},
            {"RecipeUploadTimeoutCh","RMS> 程序{0}上传失败,请求超时,请检查RMS及FTP状态!:RMS> Recipe {0} upload failed. Request Timeout.Please check RMS and FTP!"},
            #endregion
            #region RecipeDownload
            {"RecipeDownloadStartCh","RMS> 程序{0}开始下载...:RMS> Recipe {0} start download..."},
            {"RecipeDownloadEAPOKCh","RMS> 程序{0}成功下载到EAP.:RMS> Recipe {0} download success to EAP."},
            {"RecipeDownloadFailCh","RMS> 程序{0}下载失败.{1}:RMS> Recipe {0} download failed. {1}"},
            {"RecipeDownloadEQPOKCh","EAP> 程序{0}成功下载到{1}.:EAP> Recipe {0} download success to {1}."},
            {"RecipeDownloadEQPfail","EAP> 程序{0}下载{1}失败.:EAP> Recipe {0} download fail to {1}."},
            {"RecipeDownloadEQPTimeOut","EAP> 程序{0}下载到{1}超时.:EAP> Recipe {0} download to {1} time out."},
            {"RecipeDownloadUnsupportCh","当前设备不支持程序下载功能.:Current equipment not support RecipeDownload function."},
            #endregion
            #region RecipeCompare
            {"RMSConnectedFail","RMS> 获取recipeBody，请检查连接:RMS> Get RecipeBody Fail,Please Check"},
            {"RecipeCompareStartCh","RMS> 程序{0}开始比对...:RMS> Recipe {0} start compare..."},
            {"RecipeCompareOKCh","RMS> 程序{0}比对成功.:RMS> Recipe {0} compare success."},
            {"RecipeCompareFailCh","RMS> 程序{0}比对失败.{1}:RMS> Recipe {0} compare failed. {1}"},
            {"RecipeCompareUnsupportCh","当前设备不支持程序比对功能.:Current equipment not support RecipeCompare function."},
            #endregion
            #region Deamon
            {"DeamonOKCH","Deamon> Deamon {0} 成功.:Deamon> Deamon {0} Success."},
            {"DeamonFailCH","Deamon> Deamon {0} 失败.{1}:Deamon> Deamon {0} failed. {1}."},
            #endregion
            #region GetLotInfo
            {"GetLotInfoStartCh","MES> 正在获取批次{0}信息{0},请稍后...:MES> Getting lot {0} information, please wait..."},
            {"GetLotInfoOKCh","MES> 批次信息{0}获取成功.:MES> Get lot {0} information success."},
            {"GetLotInfoFailCh","MES> 批次信息{0}获取失败.{1}:MES> Get lot {0} information failed.{1}"},
            #endregion
            #region TrackIn
            {"TrackInOkCh","MES>{0}> 批次进站成功. : MES>{0}> Lot trackin success. "},
            {"TrackInFailCh","MES>{1}> 批次进站失败.{0}: MES>{1}> Lot trackin failed. {0}"},
            #endregion
            #region TrackOut
            {"TrackOutOkCh","MES>{0}> 批次出站成功.: MES>{0}> Lot trackout success. "},
            {"TrackOutFailCh","MES>{1}> 批次出站失败.{0} : MES>{1}> Lot trackout failed. {0}"},
            {"TrackOutByUser","MES> {0} 准备手动出站批次{1} : MES>{1} Will be TrackOut by {0}"},
            #endregion
            #region  Podplace
            {"PodPlacedCh","EQP> 已经放上Cassette.:EQP> Put on the Cassette."},
            #endregion
            #region  CarrierID
            {"CarrierIdOKCH","EQP> 读取CarrierID成功.:EQP>Reading CarrierID success."},
            {"CarrierIdFailCH","EQP>{0}>Lot不包含当前carrierID,当前carrierID为{0}，请检查！:EQP>{0}>Lot does not contain carrier,The current carrier for {0},Please check !"},
            {"CarrierTransfer","EQP> 载具转移到{0}中.:EQP>The carrier is moved to {0}."},
            #endregion
            #region feeder
            {"FeederOKCH","EQP> 读取Feeder：{0}、物料：{1}、数量：{2}.:EQP>Reading Feeder：{0}  Material：{1}  count：{2}."},
            #endregion
            #region EDC数据
            {"ReadyUploadEDCData","EQP>准备上传EDC数据.:EQP> Ready to upload EDC Data."},
            {"UploadEDCDataOKCh","EQP>上传EDC数据成功.:EQP> Upload EDC Data success."},
            {"UploadEDCDataFailCh","EQP>上传EDC数据失败.{0}:EQP> Upload EDC Data fail.{0}"},
            #endregion
            #region PPIDSelectedReturn
            {"SendPPIDSelectedCmdCh","EAP> {S2F41} 发送 PPSELECTED 命令.:EAP> Sending the PPSELECTED command."},
            {"PPIDSelectedReturnOkCh","EQP> 接受 PPSELECTED 命令成功.:EQP> Accept the PPSELECTED command."},
            {"PPIDSelectedReturnFailCh","EQP>PPSELECTED 命令被设备拒绝.:EQP> Send S2F41 PP_SELECT, Equipment Reject."},
            {"PPIDSelectedReturnTimeoutCh","EQP> PPSELECTED 命令 TimeOut.:EQP> PPSELECTED command timeout"},
            {"PPSelectedCh","EQP> 已经选择了当前的Recipe.:EQP> The current Recipe has been selected."},
             {"AlarmCancel","EQP> 设备正在校正,请OP消除报警后按机台reset按钮.:EQP> Equipment calibration,Please press the reset button after the alarm is eliminated."},
            #endregion
            #region S1F3
             {"SendS1F3SelectedCmdCh","EAP> 正在 发送 S1F3 命令.:EAP> Sending the S1F3 command."},
            {"S1F3SelectedReturnOkCh","EQP> 接受 S1F3 命令成功.:EQP> Accept the S1F3 command."},
            {"S1F3SelectedReturnTimeoutCh","EQP> S1F3 命令 TimeOut.:EQP> S1F3 command timeout"},
             {"ReadyStatefail","EQP> 设备状态不正确!请将设备切换到ready界面.:EQP>Equipment Incorrect State!Please switch the EQP to the ready interface"},
            #endregion
            #region StartReturn
            {"SendStartCmdCh","EAP> {S2F41} 发送 Start 命令.:EAP> Sending the Start command."},
            {"SendLotStartCmdCh","EAP> {S2F41} 发送 LotStart 命令.:EAP> Sending the LotStart command."},
            {"StartReturnOkCh","EQP> 接受 Start 命令成功.:EQP> Accept the Start command."},
            {"LotStartReturnOkCh","EQP> 接受 LotStart 命令成功.:EQP> Accept the LotStart command."},
            {"StartReturnFailCh","EQP>Start 命令被设备拒绝.:EQP> Send S2F41 Start, Equipment Reject."},
            {"LotStartReturnFailCh","EQP>LotStart 命令被设备拒绝.:EQP> Send S2F41 LotStart, Equipment Reject."},
            {"StartReturnTimeoutCh","EQP> Start 命令 TimeOut.:EQP> Start command timeout"},
            {"LotStartReturnTimeoutCh","EQP> LotStart 命令 TimeOut.:EQP> LotStart command timeout"},
            #endregion
             #region RESET
            {"SendRESETCmdCh","EAP> {S2F41} 发送 RESET 命令.:EAP> Sending the RESET command."},
            {"RESETReturnOkCh","EQP> 接受 RESET 命令成功.:EQP> Accept the RESET command."},
            {"RESETReturnFailCh","EQP>RESET 命令被设备拒绝.:EQP> Send S2F41 RESET, Equipment Reject."},
            {"RESETReturnTimeoutCh","EQP> RESET 命令 TimeOut.:EQP> RESET command timeout"},
            #endregion
              #region StopReturn
            {"SendStopCmdCh","EAP> {S2F41} 发送 Stop 命令.:EAP> Sending the Stop command."},
            {"StopReturnOkCh","EQP> 接受 Stop 命令成功.:EQP> Accept the Stop command."},
            {"StopReturnFailCh","EQP>Stop 命令被设备拒绝.:EQP> Send S2F41 Stop, Equipment Reject."},
            {"StoptReturnTimeoutCh","EQP> Stop 命令 TimeOut.:EQP> Stop command timeout"},
            #endregion
            #region PAUSEReturn
            {"SendPAUSECmdCh","EAP> {S2F41} 发送 PAUSE 命令.:EAP> Sending the PAUSE command."},
            {"PAUSEReturnOkCh","EQP> 接受 PAUSE 命令成功.:EQP> Accept the PAUSE command."},
            {"PAUSEReturnFailCh","EQP>PAUSE 命令被设备拒绝.:EQP> Send S2F41 PAUSE, Equipment Reject."},
            {"PAUSEReturnTimeoutCh","EQP> PAUSE 命令 TimeOut.:EQP> PAUSE command timeout"},
            #endregion
            #region GO REMOTE
            {"GoRemoteCmdCh","EAP> {S2F41} 发送 GoRemote 命令.:EAP> Sending the GoRemote command."},
            {"GoRemoteOkCh","EQP> 接受 GoRemote 命令成功.:EQP> Accept the GoRemote command."},
            {"GoRemoteFailCh","EQP>GoRemote 命令被设备拒绝.:EQP> Send S2F41 GoRemote, Equipment Reject."},
            {"GoRemoteTimeoutCh","EQP> GoRemote 命令 TimeOut.:EQP> GoRemote command timeout"},
            #endregion
            #region ProcessReturn
            {"ProcessStartedCh","EQP>{0}>{1}>开始作业.:EQP>{0}>{1}> Process was started"},
            {"ProcessEndCh","EQP>{0}>{1}>作业完成.:EQP>{0}>{1}> Process was completed"},
            #endregion
            #region getBin
            {"GetBinResult","EQP>DBCID{0}>{1}>Bin结果为{2}.:EQP>DBCID{0}>{1}>Bin result is {2}"},
            {"BinResultReport","EQP>正在上传bin信息.:EQP>Uploading bin information"},
            {"BinResultReportOKCH","MES>bin信息上传成功.:MES>Bin Upload success "},
            {"BinResultReportFailCH","MES>bin信息上传失败.{0}:MES>Bin Upload Fail.{0}"},
            {"UnKittingRequestOKCH","MES>{0}>下料成功.物料为{0}.:MES>{0}>UnKitting success.Material is {0}"},
            {"UnKittingRequestFailCH","MES>{0}>下料失败!{1}!物料为{0}:MES>{0}>UnKitting Fail!{1}!Material is{0}"},
            {"KittingRequestOKCH","MES>{0}>上料成功.物料为{0}:MES>{0}>Kitting success.Material is {0}"},
            {"KittingRequestFailCH","MES>{0}>上料失败!{1}!物料为{0}.:MES>{0}>Kitting Fail!{1}!Material is {0}"},
            #endregion
            #region recipe
            {"RMSCheckCh","EQP>正在校验recipe，请稍后...:EAP> Check Recipe,please wait... "},
            {"RecipeComfailCh","EQP>{0}> 设备不包含当前Lot使用的Recipe，请检查.:EQP>{0}> Equipment does not contain the Recipe for the current Lot, please check."},
            {"RecipeComfailChCount","EQP>{0}> 设备有多个当前Lot中使用的recipe，请检查.:EQP>{0}> Equipment has multiple recipes that are used in the current Lot, please check."},
            #endregion
            #region UserLogin
            {"UserLoginSuccess","EAP>用户{0}登陆成功.:EAP> User {0} login success. "},
            {"UserLoginFail","EAP> 用户{0}登陆失败.{1}:EAP> User {0} login failed.{1}"},
            {"UserLoginOverdue","EAP> 用户登陆过期,请重新登录!:EAP> User login expiration.Please login in again!"},
            #endregion
            #region carrier
             {"Msg_CarrieID","扫描载具：{0}成功!: Scan carrier：{0} success!"},
             {"Msg_Material","扫描物料：{0}成功!: Scan Material：{0} success!"},
             {"Msg_Tool","扫描治具：{0}成功!: Scan Tool：{0} success!"},
            #endregion
            #region UserLogin
            {"LotRemove","EAP> 作业信息已被{0}手动清除.:EAP> Lot data was removed by {0}."},
            #endregion
            #region Alarm
            {"AlarmReport","EQP> 报警 {0}.:EQP> Alarm {0}."},
            {"AlarmReportMESOK","MES> 接收报警{0}成功.:MES>Receive Alarm {0} success."},
            {"AlarmReportMESFail","MES> 接收报警{0}失败. {1}:MES>Receive Alarm {0} fail. {1}"},
            #endregion
            #region Login
            {"LoginMESOK","MES>{0}>登陆成功.:MES>{0}>Login success."},
            {"LoginMESFAIL","MES>{0}>登陆失败!{1}.:MES>{0}>Login fail!{1}"},
            #endregion
            #region Infotech2上传Die数据
            {"WaferIDIsNull","EQP>设备上报的waferID为空,请检查!:EQP>The waferID reported by the equipment is null.Please check!"},
            {"CarrierIDIsNull","EQP>设备上报的CarrierID为空,请检查!:EQP>The CarrierID reported by the equipment is null.Please check!"},
            {"ClampIDIsNull","EQP>设备上报的夹具ID为空,请检查!:EQP>The ClampID reported by the equipment is null.Please check!"},
            {"ReadyUploadDieData","EQP>准备上传数据...:EQP> Ready to upload Data..."},
            {"GetDieSitInWaferOKCH","MES>上传Die数据成功.:MES> Upload Die Data success."},
            {"GetDieSitInWaferFailCH","MES>上传Die数据失败.{0}:MES> Upload Die Data fail.{0}"},
            {"GetDieSitInWaferNullCH","EQP>未上传Die数据...:EQP>Not upload Die Data..."},
            {"CheckCardSlotAndMaterialOKCH","MES>上传Feeder和物料数据成功 .:MES> Upload feeder and material data success."},
            {"CheckCardSlotAndMaterialFailCH","MES>上传Feeder和物料数据失败.{0}:MES> Upload feeder and material data fail.{0}"},
            {"GetAllSiteOKCH","MES>上传数据成功.:MES> Upload Feeder success."},
            {"GetAllSiteFailCH","MES>上传数据失败.{0}:MES> Upload Feeder fail.{0}"},
            #endregion
            #region TrimForm上传时间数据
            {"ReadyUploadTime","EQP>准备上传设备的各种时间...:EQP> Ready to upload Time..."},
            {"UplodeTimeOKCH","EQP>上传时间成功.:EQP> Upload Time Data success."},
            {"UplodeTimeFailCH","EQP>上传时间失败.:EQP> Upload Time Data fail."},
            #endregion
            #region
            {"GetMesUserOK","MES>同步MES用户名成功 !:MES> Synchro MES UserName Success！"},
            {"GetMesUserFail","MES>同步MES用户名失败，请检查！:MES> Synchro MES UserName Fail,Please Check!"},
            #endregion
            {"STOPReturnOkCh","EQP> 接受STOP命令成功 !:EQP> Accept the Stop command."},
            {"ProcessStopCh","EQP> 作业停止 !:EQP> Process was Stop."},

            #region connStatus
             {"Conn","{0}> 连接成功 !:{0}>  connection successful"},
             {"DisConn","{0}> 已断开 !:{0}> Is disconnected."},
            #endregion

            #region  MES GetLotInfo
            {"GetLotInfoOK","MES>获取批次信息成功,{0}:MES>Get LOT Info Successfully,{0}"},
            {"GetLotInfoNG","MES>获取批次信息失败,{0}:MES>Get LOT Info Fail,{0}"},
            #endregion
            #region Manual Automatic   Operation
            {"ManualOperation","EAP>EAP已切换手动操作!:EAP> The EAP has been switched Manual Operation!" },
            {"AutomaticOperation","EAP>EAP已切换自动操作!:EAP> The EAP has been switched Automatic Operation!" },
            #endregion
            {"ToolTipTextOffline","点击切换到离线状态!: Click to go offline!" },
            {"ToolTipTextOnline","点击切换到在线状态!:Click to switch to online!" },

            #region Request
            {"LoginRequest","EAPClient>请求登录!:EAPClient> Login Request!" },
            {"LotInfoRequest","EAPClient>请求Lot信息!:EAPClient> Lot Information Request!" },
            #endregion
             #region Clear Date
            {"LotClearBeing","EAPClient>正在清除Lot信息!:EAPClient>Being The Cleared of Lot Info..." },
            {"LottClearEnd","EAPClient>完成清除Lot信息!:EAPClient>Complete The Cleared of Lot Info!" },
            #endregion
            #region  SelectWaferID
            {"SelectWaferIDRequest","EAPClient>发送选中的WaferID!:EAPClient>Send the Selected WaferID!" },
             {"SelectWaferIDOK","EAPServer>选择的WaferID成功，{0}!:EAPServer>The Selected WaferID Succeed, {0}" },
             {"SelectWaferIDNG","EAPServer>选择的WaferID失败!:EAPServer>The Selected WaferID Fail" },
             {"SelectWaferIDCancel","EAPServer>取消选择的WaferID!:EAPServer>Unselect The Wafer ID" },
            #endregion

        };
    }
}
